import { Module } from '@nestjs/common';
import { UserMongooseModule } from 'src/db/schemas/users.schema';
import { BaseService } from './base.service';
import { BaseController } from './base.controller';
import { JwtModule } from '@nestjs/jwt';
import { jwtConstants } from 'src/config/constants';
import { LocalStrategy } from 'src/common/strategys/local.strategy';
import { MenusService } from '../menus/menus.service';
import { MenusMongooseModule } from 'src/db/schemas/menus.schema';

@Module({
  imports: [
    UserMongooseModule,
    MenusMongooseModule,
    JwtModule.register({
      secret: jwtConstants.secret,
      verifyOptions: {
        // 忽略过期时间
        ignoreExpiration: true
      }
      // signOptions: { expiresIn: '3600s' },
    }),
  ],
  controllers: [BaseController],
  providers: [
    BaseService,
    MenusService,
    LocalStrategy
  ],
  exports: [BaseService],
})
export class BaseModule { }
